/**
 * Lists all children of the referenced (via nodeRef or documentLibrary relative path) node.
 */
function main() {
	if (args.nodeRef) {
		// call service with nodeRef param
		var node = search.findNode(args.nodeRef);
	} else {
		var docLibNode = companyhome.childByNamePath("/Sites/" + args.site
				+ "/documentLibrary")
		// call service with nodePath param
		var node = docLibNode.childByNamePath(args.nodePath);
	}

	model.children = node.children;
}

main();
